import React, { useState } from 'react';
import {
  MenuFoldOutlined,
  MenuUnfoldOutlined,
  PieChartOutlined,
  MailOutlined,
  TeamOutlined,
  TransactionOutlined,
  UsergroupAddOutlined,
  SettingOutlined
} from '@ant-design/icons';
import { Button, Layout, Menu, theme } from 'antd';

const { Header, Sider, Content } = Layout;

const App: React.FC = () => {
  const [collapsed, setCollapsed] = useState(false);
  const {
    token: { colorBgContainer, borderRadiusLG },
  } = theme.useToken();


const items= [
  { key: "1", icon: <PieChartOutlined />, label: `首页` },
  {
    key: "2",
    label: "销售管理",
    icon: <MailOutlined />,
    children: [{ key: "21", label: "广告管理" }],
  },
  {
    key: "3",
    label: "用户管理",
    icon: <TeamOutlined />,
    children: [
      { key: "31", label: "工人管理" },
      { key: "32", label: "雇主管理" },
    ],
  },
  {
    key: "4",
    label: "招工管理",
    icon: <UsergroupAddOutlined />,
    children: [
      { key: "41", label: "任务管理" },
      { key: "42", label: "工种管理" },
    ],
  },
  {
    key: "5",
    label: "财务管理",
    icon: <TransactionOutlined />,
    children: [
      { key: "51", label: "资金明细" },
      { key: "52", label: "提现申请" },
    ],
  },
  { key: "6", icon: <SettingOutlined />, label: `系统管理` },
];


  return (
    <Layout style={{ minHeight: '100vh' }}>
      <Sider trigger={null} collapsible collapsed={collapsed}>
        <div className="demo-logo-vertical" />
        <Menu
          theme="dark"
          mode="inline"
          defaultSelectedKeys={['1']}
          items={items}
        />
      </Sider>
      <Layout>
        <Header style={{ padding: 0, background: colorBgContainer }}>
          <Button
            type="text"
            icon={collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}
            onClick={() => setCollapsed(!collapsed)}
            style={{
              fontSize: '16px',
              width: 64,
              height: 64,
            }}
          />
        </Header>
        <Content
          style={{
            margin: '24px 16px',
            padding: 24,
            minHeight: 280,
            background: colorBgContainer,
            borderRadius: borderRadiusLG,
          }}
        >
          Content
        </Content>
      </Layout>
    </Layout>
  );
};

export default App;